<?php

require_once('Adept/ClassKit/Delegate/Interface.php');

class Adept_ClassKit_Delegate_Function implements Adept_ClassKit_Delegate_Interface 
{
    
    protected $function;
    protected $file;
    
    public function __construct($function, $file = null)    
    {
        $this->function = $function;
        $this->file = $file;    
    }
    
    public function invoke($args) 
    {
        if (is_null($this->function)) {
            require_once($this->function);
        }
        return call_user_method_array($this->function, $args);
    }
    
}

